1. Field of the Invention
The present invention relates to a technology of coding and decoding moving pictures and, more particularly, to a technology of coding and decoding moving pictures by using motion compensation prediction.
2. Description of the Related Art
The MPEG-4 AVC/H.264 standard is known as a typical method for compression coding of moving pictures. In motion compensation according to MPEG-4 AVC/H.264, a picture is partitioned into a plurality of rectangular blocks. A picture already coded and decoded is used as a reference picture. Motion from the reference picture is predicted. Motion prediction based on motion compensation is referred to as inter prediction or motion compensation prediction. In inter prediction according to MPEG-4 AVC/H.264, a plurality of pictures can be used as reference pictures. For motion compensation, an optimum reference for each block picture is selected from the plurality of reference pictures. A reference index is assigned to each reference picture. A reference picture is identified by the reference index. In a B picture, a maximum of two pictures may be selected from the reference pictures already coded and decoded and may be used for inter prediction. Prediction from one of the two reference pictures is denoted by L0 prediction (list 0 prediction), which is primarily used for forward prediction, and prediction from the other is denoted by L1 prediction (list 1 prediction), which is primarily used for backward prediction.
Bi-prediction, which uses two types of inter prediction, i.e., L0 prediction and L1 prediction, is also defined. In the case of bi-prediction, two predictions are performed. Inter prediction signals from L0 prediction and L1 prediction are multiplied by respective weight factors, and offset values are added to the respective results of multiplication. The resultant signals are superimposed on each other to produce an ultimate inter prediction picture signal. Typical values of weight factors and offset values used for weighted prediction are defined and coded in units of pictures and for each reference picture in a list. Coding information related to inter prediction defined for each block includes a prediction mode for distinguishing between L0 prediction, L1 prediction, and bi-prediction. Coding information defined for each reference list for a given block includes a reference index identifying a reference picture, and a motion vector indicating the direction and amount of movement of the block. These items of coding information are coded and decoded.
Further, in MPEG-4 AVC/H.264, a direct mode is defined where inter prediction information of a block to be coded or decoded is generated from inter prediction information of a block that has been coded or decoded. Coding of inter prediction information is unnecessary in the direct mode. Thus, coding efficiency is improved.
An explanation will be made using FIG. 29 regarding a temporal direct mode where the correlation of inter prediction information in a temporal direction is used. A picture having an L1 reference index added as zero is referred to as a reference picture colPic. A block located at the same position as a coding or decoding target block in the reference picture colPic is referred to as a reference block.
If the reference block has been coded using L0 prediction, the L0 motion vector of the reference block is referred to as a reference motion vector mvCol. If the reference block has not been coded using L0 prediction, and if the reference block has been coded using L1 prediction, the L1 motion vector of the reference block is referred to as the reference motion vector mvCol. A picture referred to by the reference motion vector mvCol is referred to as an L0 reference picture in the temporal direct mode, and the reference picture colPic is referred to as an L1 reference picture in the temporal direct mode.
By scaling operation processing, an L0 motion vector mvL0 and an L1 motion vector mvL1 in the temporal direct mode are derived from the reference motion vector mvCol.
An inter-picture distance td is derived by subtracting the POC of the L0 reference picture in the temporal direct mode from the POC of the reference picture colPic. POC is a variable mapped to a coded picture. A value incremented by 1 at a time in an output sequence of a picture is set in POC. A difference in POC between two pictures shows an inter-picture distance in a time axis direction.td=(POC of reference picture colPic)−(POC of L0 reference picture in temporal direct mode)
The inter-picture distance td is derived by subtracting the POC of the L0 reference picture in the temporal direct mode from the POC of a picture subject to coding or decoding.tb=(POC of picture subject to coding or decoding)−(POC of L0 reference picture in temporal direct mode)
By scaling operation processing, an L0 motion vector mvL0 in the temporal direct mode is derived from the reference motion vector mvCol.mvL0=tb/td*mvCol
The L1 motion vector mvL1 is derived by subtracting the reference motion vector mvCol from the L0 motion vector mvL0 in the temporal direct mode.mvL1=mvL0−mvCol
[Patent document 1] JP 2004-129191
In conventional methods, the number of motion information candidates that are referred to for each block by motion compensation is fixed conventionally, and there are thus cases where coding efficiency is not improved.
In this background, the inventors of the present invention have come to be aware of a need to provide a moving picture coding scheme based on motion compensation prediction in which the coding information is further compressed and the overall code size is reduced.